package net.messagenet.mazor.infra.persistence.entities;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * 
 * This entity bean represents a POS report 
 * Containing all the data need for the excel sheet.
 * 
 * @author Idan
 *
 */


@Entity
@Table(name="MZR_POS")
@Inheritance
public class Pos implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)

	private int id;
	private Date date;

	private String email;
	private String cc;
	private boolean draft;
	private String fileName;

	@OneToMany(mappedBy="pos")
    private List<PosProduct> posProducts;
	
	
	
	/**
	 * returns the list of all the products that contained within this pos
	 * 
	 * @return products list
	 */
	
	public List<PosProduct> getPosProducts() {
		return posProducts;
	}
	/**
	 * sets the list of all the products that contained within this pos
	 * 
	 * @param products list
	 */
	
	public void setPosProducts(List<PosProduct> posProducts) {
		this.posProducts = posProducts;
	}
	/**
	 * returns the email of the sender
	 * 
	 * @return  email of the sender
	 */
	public String getEmail() {
		return email;
	}
	/**
	 * sets the email of the sender 
	 * 
	 * @param email
	 */
	public void setEmail(String email) {
		this.email = email;
	}
	
	
	/**
	 * returns the id of the pos request given by mazor system 
	 * 
	 * @return id
	 */
	public int getId() {
		return id;
	}
	/**
	 * sets the id of the pos
	 * 
	 * @param id - sets a new id for the DPA request
	 */
	public void setId(int id) {
		this.id = id;
	}
	/**
	 * returns  the  date of the POS request
	 * 
	 * @return  date
	 */
	public Date getDate() {
		return date;
	}
	/**
	 * sets the date of the POS request
	 * 
	 * @param date 
	 */
	public void setDate(Date date) {
		this.date = date;
	}

	/**
	 * sets the the cc field in the email sending 
	 * 
	 * @param cc
	 */
	public void setCc(String cc) {
		this.cc = cc;
	}
	/**
	 * returns the cc field in the email sending
	 * 
	 * @return cc
	 */
	public String getCc() {
		return cc;
	}
	/**
	 * returns the draft state of the pos
	 * 
	 * @return draft
	 */
	public boolean isDraft() {
		return draft;
	}
	/**
	 * set if the pos is a draft or not 
	 * 
	 * @param isDraft
	 */
	public void setDraft(boolean draft) {
		this.draft = draft;
	}
	/**
	 * 
	 * gets the file name of which the excel report will be saved.
	 * 
	 * @param fileName
	 */
	public void setFileName(String fileName) {
		this.fileName = fileName;
	}
	/**
	 * returns the file name of which the excel report will be saved.
	 * 
	 * @return fileName
	 */
	public String getFileName() {
		return fileName;
	}
}
